package com.example.demo.controller;

import com.example.demo.model.DBTypes;
import com.example.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/hi")  //路由映射
public class HelloController {

    @Value("${server.port}")
    private  Integer port;

    @Value("${myconfig.sayHi}")
    private String myconfig;

    @Value("${myconfig.msg}")
    private  String msg;
//    @Value("${mystr}")
//    private String mystr;
//    @Value("${mystr2}")
//    private String mystr2;
//    @Value("${mystr3}")
//    private String mystr3;



    @Value("${student}")
    @Autowired
    private Student student;

    @Value("${dbTypes}")
    private DBTypes dbTypes;
    @RequestMapping("/index")  //路由映射
    @ResponseBody  //返回一个非静态界面的数据
    public String sayHi(){
//        System.out.println("---------start---------");
//        System.out.println("mystr:"+mystr);
//        System.out.println("mystr2:"+mystr2);
//        System.out.println("mystr3:"+mystr3);
//        System.out.println("--------end----------");
        System.out.println(student);
        return "dbtypes"+dbTypes;
    }

}
